package com.lwq.controller.system;

import com.lwq.annotation.PermissionInterface;
import com.lwq.controller.BaseController;
import com.lwq.model.Dto;
import com.lwq.model.Dtos;
import com.lwq.service.system.PermissionService;
import com.lwq.util.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Description:
 * Author: LiuWenQing
 * Datetime: 2021/6/11
 */
@com.lwq.annotation.PermissionController(type="system")
@RestController
public class PermissionController extends BaseController {

    @Autowired
    private PermissionService service;

    @GetMapping(value="/permission/list")
    @PermissionInterface(code = "permission.query", name="查询权限")
    public TableDataInfo list(){
        Dto dto = Dtos.newDto(request);
        startPage();
        return getDataTable(service.getAllPermissions(dto));
    }

}
